<template>
   <div style="background-color: #fff;">
      <div class="choiceTit">
          <div>选择您的身份标签</div>
          <p>不同的身份标签对应不同的功能权限</p>
      </div>
      <div class="selectShen">
          <img @click="changeRole('Teacher')" src="./img/teacher.png" alt="">
          <img @click="changeRole('Parent')" src="./img/parent.png" alt="">
      </div>
   </div>
</template>
<script>
import {setCookie} from '@/util/tool'
import {refreshToken} from '@/api/commonApi'
import cookie from '@/util/cookie'
export default {
    computed: {
        childList () {
            return this.$store.state.user.childList
        }
    },
    methods: {
        changeRole (role) {
            localStorage.role = '123'
            // setCookie('roleCode', role, 0)
            // this.$store.state.user.roleCode = role
            if(role == 'Teacher'){
               this.$router.push('/myNew/establish')
            }else{
                
                // if(localStorage.getItem("localQRCode")){
                    this.$router.push('/myNew/addChildren')
                // }else{
                //     this.$router.push('/myNew/mode')
                // }
            }
            // var self = this
            
            // setCookie('roleCode', role, 0)
            // this.$store.state.user.roleCode = role
            
            //  this.$store.state.user.isSchoolAdmin = false
            // this.$store.state.user.reloadToken = true
            //  this.$router.push('/menu/index')
        },
        refreshToken () { 
        }
    },
    mounted () {
        
    }
}
</script>
<style scoped>
.choiceTit{
    margin-top: 0.88rem;
    margin-left: 0.57rem;
}
.choiceTit div{
    font-size: 0.34rem;
    color: #1B1F27;
    font-weight: bold;
}
.choiceTit p{
    color: #595C61;
    font-size: 0.26rem;
    margin-top: 0.2rem;
}
.selectShen{
    margin-top: 1.1rem;
    text-align: center;
}
.selectShen img{
    width: 6.04rem;
    height: 2.26rem;
    margin-bottom: 0.3rem;
}
</style>